import request from '@/utils/request'

// 查询标注物体列表
export function annotationList(query) {
  return request({
    url: '/mark/markAnnotation/annotationList',
    method: 'get',
    params: query,
  })
}

// 添加标注物体
export function addAnnotation(data) {
  return request({
    url: '/mark/markAnnotation/addAnnotation',
    method: 'post',
    data: data,
  })
}

// 修改标注物体
export function editAnnotation(data) {
  return request({
    url: '/mark/markAnnotation',
    method: 'put',
    data: data,
  })
}

// 更新标注物体
export function updateAnnotation(data) {
  return request({
    url: '/mark/markAnnotation/updateAnnotation',
    method: 'post',
    data: data,
  })
}

// 更新标注物体属性
export function updateAnnotationAttributes(data) {
  return request({
    url: '/mark/markAnnotation/updateAnnotationAttributes',
    method: 'post',
    data: data,
  })
}

// 删除标注物体
export function deleteAnnotation(mMarkAnnotationIds) {
  return request({
    url: '/mark/markAnnotation/' + mMarkAnnotationIds,
    method: 'delete',
  })
}

export function autoAnnotation(taskId, qaResultId) {
  return request({
    url: '/mark/markAnnotation/autoAnnotation?taskId=' + taskId + '&qaResultId=' + qaResultId,
    method: 'put',
  })
}

export function copyPreviousAnnotation(sourceResultId, targetResultId) {
  return request({
    url:
      '/mark/markAnnotation/copyPreviousAnnotation?sourceResultId=' +
      sourceResultId +
      '&targetResultId=' +
      targetResultId,
    method: 'put',
  })
}
